var exec = require('child_process').exec;
var execSync = require('child_process').execSync;
function runShell(cmd) {
    console.log(cmd,'cmd')
    return new Promise(resolve => {
        exec(cmd, function (error, stdout, stderr) {
            console.log(error,stdout, stderr)
            if (error) {
                resolve({
                    code:0,
                    cmd:cmd,
                    msg:stdout || stderr
                })
            } else {
                resolve({
                    code:1,
                    cmd:cmd,
                    msg:stdout || stderr
                })
            }
        });
    })
}
module.exports.runShell = runShell
function callCmd(cmd) {
    execSync("start cmd.exe /K " + cmd);
}
module.exports.callCmd = callCmd
